<template>
  <div class="project-List">
    <div
      class="project-List-photo"
      :style="{background: `url('${ projectData.images[0].thumbnail_url }') center center no-repeat`,backgroundSize:'100% 100%'}"
      @click="isAlertBlock"
    />
    <div class="project-List-content" @click="isAlertBlock">
      <div class="project-List-content-title">
        <div class="project-List-content-title-icon" />
        <div class="project-List-content-title-text">
          {{ projectData.product_name }}
        </div>
      </div>
      <div class="project-List-content-project-price-wrap">
        <div class="project-List-content-project-price">
          <div class="project-List-content-project-price-icon">
            券后价
          </div>
          <div class="project-List-content-project-price-text">
            ￥{{ projectData.package.sale.coupon_price }}
          </div>
        </div>
        <div class="project-List-content-consultation">
          {{ projectData.browse_count+666 }}人已购买
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  components: {

  },
  props: {
    projectData: {
      type: Object,
      default: () => { }
    }
  },
  data() {
    return {
      price: ''
    }
  },
  computed: {

  },
  created() {
  },
  mounted() {
  },
  methods: {
    isAlertBlock() {
      this.$emit('isAlert', { Alerts: true, product_id: this.projectData.product_id })
    },
    init() {
      // if( this.projectData.yycoupon != null){
      // }else{

      // }
    // projectData.package.sale.selling_price - projectData.yycoupon.discount_amount : projectData.package.sale.selling_price
    }
  }
}
</script>
<style scoped lang="scss">
.project-List {
  margin-bottom: 10px;
}
.project-List-photo:hover{
  cursor: pointer;
}
.project-List-photo {
 width:285px;
  height:260px;
  border-radius: 4px 4px 0px 0px;
}
.project-List-content:hover{
  cursor: pointer;
}
.project-List-content {
  width: 285px;
  height: 100px;
  .project-List-content-title {
    margin-top: 10px;
    display: flex;
    position: relative;
    .project-List-content-title-icon {
      width: 20px;
      height: 20px;
      background: url("~assets/img/volume-icon.png") center center no-repeat;
      background-size: 100% 100%;
      position: absolute;
    }
    .project-List-content-title-text {
      width: 266px;
      height: 45px;
      font-size: 16px;
      font-weight: 600;
      color: rgba(51, 51, 51, 1);
      line-height: 22px;
      margin-left: 7px;
      text-overflow: -o-ellipsis-lastline;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      text-indent: 1em;
    }
    .project-List-content-title-text:hover{
      cursor: pointer;
    }
  }

  .project-List-content-project-price-wrap {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    align-items: center;
    .project-List-content-project-price{
      width:158px;
      height:35px;
      border-radius:4px;
      border:1px solid rgba(255,59,88,1);
      display: flex;
      .project-List-content-project-price-icon{
        width:75px;
        height:35px;
        background:rgba(255,59,88,1);
        border-radius:4px 0px 0px 4px;
        border:1px solid rgba(255,59,88,1);
        text-align: center;
        line-height: 33px;
        font-family:PingFangSC-Regular,PingFang SC;
        font-weight:400;
        color:rgba(255,255,255,1);
        font-size:20px;
      }
      .project-List-content-project-price-text{
        flex: 1;
        font-size:22px;
        font-family:PingFangSC-Regular,PingFang SC;
        font-weight:400;
        color:rgba(255,59,88,1);
        line-height:33px;
        text-align: center;
      }
    }
    .project-List-content-consultation{
      font-size:18px;
      font-family:PingFangSC-Regular,PingFang SC;
      font-weight:400;
      color:rgba(51,51,51,1);
      line-height:25px;
    }
  }
}
</style>
